/*
 * Created on 02.05.2006
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package ro.qi.framework.sys.users.profile.entities;

/**
 * @author Luiza Varovici
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */

import ro.qi.framework.sys.entities.Entity;

public class UsersAccountProfileAnswer extends Entity {

	public UsersAccountProfileAnswer() {
		super();
	}

	public UsersAccountProfileAnswer(Integer id) {
		super();
		setValue("id", id);
		select();
	}

	public UsersAccountProfileAnswer(int id) {
		super();
		setValue("id", new Integer(id));
		select();
	}

	public int getId() {
		return ((Integer)getValue("id")).intValue();
	}

	public void setQuestionId(int value) {
		setValue("questionId", new Integer(value));
	}

	public int getQuestionId() {
		return ((Integer)getValue("questionId")).intValue();
	}

	public void setText(String value) {
		setValue("text", value);
	}

	public String getText() {
		return (String)getValue("text");
	}

	public void setPrevId(int value) {
		setValue("prevId", new Integer(value));
	}

	public int getPrevId() {
		return ((Integer)getValue("prevId")).intValue();
	}

	public void setNextId(int value) {
		setValue("nextId", new Integer(value));
	}

	public int getNextId() {
		return ((Integer)getValue("nextId")).intValue();
	}

	public void setPublished(boolean value) {
		setValue("published", new Integer((value)?1:0));
	}

	public boolean isPublished() {
		return ((Integer)getValue("published")).intValue() == 1;
	}
	
	public UsersAccountProfileAnswer getNextAnswer() {
		if( getNextId() > 0 )
			return new UsersAccountProfileAnswer(getNextId());
		return null;
	}

}
